﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;
using System.Windows;
using Hyperbolic.Vectors;
using Hyperbolic.Model;

namespace Hyperbolic.Converters
{
    public class ScaleConverter : IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {

            if (values[0] == DependencyProperty.UnsetValue || values[1] == DependencyProperty.UnsetValue)
                return Binding.DoNothing;

            EuclidianVector __ze = (EuclidianVector)values[0];
            NodeModel __nodeModel = (NodeModel)values[1];
            double __d = __ze.GetDistance();
            return 1 - __d;

        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException("Cannot convert back");
        }

        #endregion
    }
}
